package cn.gzsf.springboot10.controller;

import cn.gzsf.springboot10.entity.Weibo;
import cn.gzsf.springboot10.mapper.WeiboMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class WeiboController {
    @Autowired
    private WeiboMapper weiboMapper;

    @RequestMapping("/insert")
    public void insert(@RequestBody Weibo weibo){
        weiboMapper.insert(weibo);
    }

    @RequestMapping("/select")
    public List<Weibo> select(){
        return weiboMapper.select();
    }
}
